package com.cgx.dao;

import com.cgx.entity.message.Message;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface MessageDao extends MongoRepository<Message, String> {

    List<Message> findAllBySessionIdInAndIsDeleteOrderByCreateTimeDesc(String sessionId, int isDelete);

    List<Message> findAllBySessionIdInAndIsDeleteAndCreateTimeBeforeOrderByCreateTimeDesc(String sessionId, int isDelete, Date createTime);
}
